<template>
  <div>
    <h1>新增学员</h1>
    <Add @add="addList" :studentLists="list"  />
    <h1>就业榜</h1>
    <Obtain :reduce="list" @del="delList" />
  </div>
</template>

<script>
import Add from "./components/Add.vue";
import Obtain from "./components/Obtain.vue";
export default {
  components: {
    Add,
    Obtain,
  },
  data() {
    return {
      list : JSON.parse(localStorage.getItem('studentList')) || []
    }
  },
  methods : {
    addList(i){
      console.log(i);
      this.list = i
    },
    delList(i) {
      this.list = i
    }
  }
};
</script>

<style>
* {
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: #721c24;
}
h1 {
  text-align: center;
  color: #333;
  margin: 20px 0;
}
table {
  margin: 0 auto;
  width: 800px;
  border-collapse: collapse;
  color: #004085;
}
th {
  padding: 10px;
  background: #cfe5ff;

  font-size: 20px;
  font-weight: 400;
}
td,
th {
  border: 1px solid #b8daff;
}
td {
  padding: 10px;
  color: #666;
  text-align: center;
  font-size: 16px;
}
tbody tr {
  background: #fff;
}
tbody tr:hover {
  background: #e1ecf8;
}
.info {
  width: 900px;
  margin: 50px auto;
  text-align: center;
}
.info input,
.info select {
  width: 80px;
  height: 27px;
  outline: none;
  border-radius: 5px;
  border: 1px solid #b8daff;
  padding-left: 5px;
  box-sizing: border-box;
  margin-right: 15px;
}
.info button {
  width: 60px;
  height: 27px;
  background-color: #004085;
  outline: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  border-radius: 5px;
}
.info .age {
  width: 50px;
}
</style>